package com.example.mvp

import android.util.Log
import androidx.lifecycle.LifecycleOwner
import com.example.mvp.presenter.IBasePresenter

class UserInfoPresenter: IBasePresenter<IUserInfoView>() {
    companion object {
        const val TAG = "UserInfoPresenter"
    }
    fun showUserInfo() {
        val userInfo = UserInfo("Jason", "Male", 20)
        (view as IUserInfoView).showUserInfo(userInfo)
    }

    override fun onCreate(owner: LifecycleOwner) {
        super.onCreate(owner)
        Log.d(TAG, "onCreate()")
    }

    override fun onStart(owner: LifecycleOwner) {
        super.onStart(owner)
        Log.d(TAG, "onStart()")
    }

    override fun onResume(owner: LifecycleOwner) {
        super.onResume(owner)
        Log.d(TAG, "onResume()")
    }

    override fun onPause(owner: LifecycleOwner) {
        super.onPause(owner)
        Log.d(TAG, "onPause()")
    }

    override fun onStop(owner: LifecycleOwner) {
        super.onStop(owner)
        Log.d(TAG, "onStop()")
    }

    override fun onDestroy(owner: LifecycleOwner) {
        super.onDestroy(owner)
        Log.d(TAG, "onDestroy()")
    }


}